Optimal. Leaf size=130 \[ -\frac {i d (1+i c x)^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c}+\frac {2 b d \log \left (\frac {2}{1-i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )}{c}-i a b d x+\frac {i b^2 d \log \left (c^2 x^2+1\right )}{2 c}-\frac {i b^2 d \text {Li}_2\left (1-\frac {2}{1-i c x}\right )}{c}-i b^2 d x \tan ^{-1}(c x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 7, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.350, Rules used = {4864, 4846, 260, 1586, 4854, 2402, 2315} \[ -\frac {i b^2 d \text {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{c}-\frac {i d (1+i c x)^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c}+\frac {2 b d \log \left (\frac {2}{1-i c x}\right ) \left (a+b \tan ^{-1}(c x)\right )}{c}-i a b d x+\frac {i b^2 d \log \left (c^2 x^2+1\right )}{2 c}-i b^2 d x \tan ^{-1}(c x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 260
Rule 1586
Rule 2315
Rule 2402
Rule 4846
Rule 4854
Rule 4864
Rubi steps
\begin {align*} \int (d+i c d x) \left (a+b \tan ^{-1}(c x)\right )^2 \, dx &=-\frac {i d (1+i c x)^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c}+\frac {(i b) \int \left (-d^2 \left (a+b \tan ^{-1}(c x)\right )-\frac {2 i \left (i d^2-c d^2 x\right ) \left (a+b \tan ^{-1}(c x)\right )}{1+c^2 x^2}\right ) \, dx}{d}\\ &=-\frac {i d (1+i c x)^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c}+\frac {(2 b) \int \frac {\left (i d^2-c d^2 x\right ) \left (a+b \tan ^{-1}(c x)\right )}{1+c^2 x^2} \, dx}{d}-(i b d) \int \left (a+b \tan ^{-1}(c x)\right ) \, dx\\ &=-i a b d x-\frac {i d (1+i c x)^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c}+\frac {(2 b) \int \frac {a+b \tan ^{-1}(c x)}{-\frac {i}{d^2}-\frac {c x}{d^2}} \, dx}{d}-\left (i b^2 d\right ) \int \tan ^{-1}(c x) \, dx\\ &=-i a b d x-i b^2 d x \tan ^{-1}(c x)-\frac {i d (1+i c x)^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c}+\frac {2 b d \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac {2}{1-i c x}\right )}{c}-\left (2 b^2 d\right ) \int \frac {\log \left (\frac {2}{1-i c x}\right )}{1+c^2 x^2} \, dx+\left (i b^2 c d\right ) \int \frac {x}{1+c^2 x^2} \, dx\\ &=-i a b d x-i b^2 d x \tan ^{-1}(c x)-\frac {i d (1+i c x)^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c}+\frac {2 b d \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac {2}{1-i c x}\right )}{c}+\frac {i b^2 d \log \left (1+c^2 x^2\right )}{2 c}-\frac {\left (2 i b^2 d\right ) \operatorname {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1-i c x}\right )}{c}\\ &=-i a b d x-i b^2 d x \tan ^{-1}(c x)-\frac {i d (1+i c x)^2 \left (a+b \tan ^{-1}(c x)\right )^2}{2 c}+\frac {2 b d \left (a+b \tan ^{-1}(c x)\right ) \log \left (\frac {2}{1-i c x}\right )}{c}+\frac {i b^2 d \log \left (1+c^2 x^2\right )}{2 c}-\frac {i b^2 d \text {Li}_2\left (1-\frac {2}{1-i c x}\right )}{c}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.27, size = 151, normalized size = 1.16 \[ \frac {i d \left (a^2 c^2 x^2-2 i a^2 c x+2 i a b \log \left (c^2 x^2+1\right )+2 b \tan ^{-1}(c x) \left (a c^2 x^2-2 i a c x+a-b c x-2 i b \log \left (1+e^{2 i \tan ^{-1}(c x)}\right )\right )-2 a b c x+b^2 \log \left (c^2 x^2+1\right )-2 b^2 \text {Li}_2\left (-e^{2 i \tan ^{-1}(c x)}\right )+b^2 (c x-i)^2 \tan ^{-1}(c x)^2\right )}{2 c} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.46, size = 0, normalized size = 0.00 \[ \frac {1}{8} \, {\left (-i \, b^{2} c d x^{2} - 2 \, b^{2} d x\right )} \log \left (-\frac {c x + i}{c x - i}\right )^{2} + {\rm integral}\left (\frac {2 i \, a^{2} c^{3} d x^{3} + 2 \, a^{2} c^{2} d x^{2} + 2 i \, a^{2} c d x + 2 \, a^{2} d - {\left (2 \, a b c^{3} d x^{3} - {\left (2 i \, a b + b^{2}\right )} c^{2} d x^{2} + {\left (2 \, a b + 2 i \, b^{2}\right )} c d x - 2 i \, a b d\right )} \log \left (-\frac {c x + i}{c x - i}\right )}{2 \, {\left (c^{2} x^{2} + 1\right )}}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \mathit {sage}_{0} x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.11, size = 367, normalized size = 2.82 \[ a^{2} d x -\frac {i d \,b^{2} \ln \left (c x +i\right )^{2}}{4 c}+d \,b^{2} \arctan \left (c x \right )^{2} x +\frac {i d \,b^{2} \ln \left (c x -i\right ) \ln \left (-\frac {i \left (c x +i\right )}{2}\right )}{2 c}+\frac {i c d \,a^{2} x^{2}}{2}-\frac {i d \,b^{2} \ln \left (c x +i\right ) \ln \left (\frac {i \left (c x -i\right )}{2}\right )}{2 c}-\frac {d \,b^{2} \arctan \left (c x \right ) \ln \left (c^{2} x^{2}+1\right )}{c}+\frac {i d \,b^{2} \ln \left (c x +i\right ) \ln \left (c^{2} x^{2}+1\right )}{2 c}-i a b d x -\frac {i d \,b^{2} \dilog \left (\frac {i \left (c x -i\right )}{2}\right )}{2 c}+\frac {i d \,b^{2} \arctan \left (c x \right )^{2}}{2 c}-i b^{2} d x \arctan \left (c x \right )+\frac {i d \,b^{2} \dilog \left (-\frac {i \left (c x +i\right )}{2}\right )}{2 c}+\frac {i b^{2} d \ln \left (c x -i\right )^{2}}{4 c}-\frac {i d \,b^{2} \ln \left (c x -i\right ) \ln \left (c^{2} x^{2}+1\right )}{2 c}+\frac {i b^{2} d \ln \left (c^{2} x^{2}+1\right )}{2 c}+\frac {i c d \,b^{2} \arctan \left (c x \right )^{2} x^{2}}{2}+i c d a b \arctan \left (c x \right ) x^{2}+2 d a b \arctan \left (c x \right ) x +\frac {i d a b \arctan \left (c x \right )}{c}-\frac {d a b \ln \left (c^{2} x^{2}+1\right )}{c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ 4 \, b^{2} c^{3} d \int \frac {x^{3} \arctan \left (c x\right ) \log \left (c^{2} x^{2} + 1\right )}{16 \, {\left (c^{2} x^{2} + 1\right )}}\,{d x} + 4 \, b^{2} c^{3} d \int \frac {x^{3} \arctan \left (c x\right )}{16 \, {\left (c^{2} x^{2} + 1\right )}}\,{d x} + \frac {1}{2} i \, a^{2} c d x^{2} + 12 \, b^{2} c^{2} d \int \frac {x^{2} \arctan \left (c x\right )^{2}}{16 \, {\left (c^{2} x^{2} + 1\right )}}\,{d x} + b^{2} c^{2} d \int \frac {x^{2} \log \left (c^{2} x^{2} + 1\right )^{2}}{16 \, {\left (c^{2} x^{2} + 1\right )}}\,{d x} + 6 \, b^{2} c^{2} d \int \frac {x^{2} \log \left (c^{2} x^{2} + 1\right )}{16 \, {\left (c^{2} x^{2} + 1\right )}}\,{d x} + i \, {\left (x^{2} \arctan \left (c x\right ) - c {\left (\frac {x}{c^{2}} - \frac {\arctan \left (c x\right )}{c^{3}}\right )}\right )} a b c d + \frac {b^{2} d \arctan \left (c x\right )^{3}}{4 \, c} + 4 \, b^{2} c d \int \frac {x \arctan \left (c x\right ) \log \left (c^{2} x^{2} + 1\right )}{16 \, {\left (c^{2} x^{2} + 1\right )}}\,{d x} - 8 \, b^{2} c d \int \frac {x \arctan \left (c x\right )}{16 \, {\left (c^{2} x^{2} + 1\right )}}\,{d x} + a^{2} d x + b^{2} d \int \frac {\log \left (c^{2} x^{2} + 1\right )^{2}}{16 \, {\left (c^{2} x^{2} + 1\right )}}\,{d x} + \frac {{\left (2 \, c x \arctan \left (c x\right ) - \log \left (c^{2} x^{2} + 1\right )\right )} a b d}{c} + \frac {1}{32} \, {\left (4 i \, b^{2} c d x^{2} + 8 \, b^{2} d x\right )} \arctan \left (c x\right )^{2} - \frac {1}{8} \, {\left (b^{2} c d x^{2} - 2 i \, b^{2} d x\right )} \arctan \left (c x\right ) \log \left (c^{2} x^{2} + 1\right ) + \frac {1}{32} \, {\left (-i \, b^{2} c d x^{2} - 2 \, b^{2} d x\right )} \log \left (c^{2} x^{2} + 1\right )^{2} + i \, \int -\frac {12 \, b^{2} c^{2} d x^{2} \arctan \left (c x\right ) - 12 \, {\left (b^{2} c^{3} d x^{3} + b^{2} c d x\right )} \arctan \left (c x\right )^{2} - {\left (b^{2} c^{3} d x^{3} + b^{2} c d x\right )} \log \left (c^{2} x^{2} + 1\right )^{2} - 2 \, {\left (b^{2} c^{3} d x^{3} - 2 \, b^{2} c d x - 2 \, {\left (b^{2} c^{2} d x^{2} + b^{2} d\right )} \arctan \left (c x\right )\right )} \log \left (c^{2} x^{2} + 1\right )}{16 \, {\left (c^{2} x^{2} + 1\right )}}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int {\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2\,\left (d+c\,d\,x\,1{}\mathrm {i}\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________